package com.customer.Test;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.cloud.stream.messaging.Sink;
import org.springframework.messaging.Message;
import org.springframework.stereotype.Component;

/**
 * @author cyt
 * @create 2020-05-31 16:41
 */
@EnableBinding(Sink.class)
@Component
public class MqController {

    @Value("${server.port}")
    public String ports;

    @StreamListener(Sink.INPUT)
    public void input(Message<String> message) {
        System.out.println("receive message: " + message.getPayload() + "\t" + ports);
    }
}
